from selenium import webdriver
from selenium.webdriver.common.by import By
import time

# devier=webdriver.Edge()
# devier1=webdriver.Chrome()
# devier2=webdriver.Firefox()
# devier2.maximize_window()
# devier.get('http://baidu.com')
# devier1.get('http://baidu.com')
# devier2.get('http://baidu.com')
# devier.find_element(By.ID,'kw').send_keys('1')
# devier.find_element(By.ID,'su').click()
# devier.find_element(By.NAME,'wd').send_keys(123)
# devier.find_element(By.CLASS_NAME,'s_ipt').send_keys('123')
# devier.find_element(By.XPATH,'//*[@id="kw"]').send_keys('菠萝头')
# devier.find_element(By.XPATH,'/html/body/div[1]/div[1]/div[5]/div/div/form/span[1]/input').send_keys('111')
# devier.find_element(By.CSS_SELECTOR,'#kw').send_keys('aaa建材')
# devier.find_element(By.CSS_SELECTOR,'form#form.fm.has-soutu span.bg.s_ipt_wr.new-pmd.quickdelete-wrap input#kw.s_ipt').send_keys(111)


# devier.find_element(By.LINK_TEXT,'新闻').click()
# # 切换新窗口
# devier.switch_to.window(devier.window_handles[-1])
# time.sleep(5)
# devier.find_element(By.PARTIAL_LINK_TEXT,'小树苗').click()
# # 切换新窗口
# devier.switch_to.window(devier.window_handles[-1])
# time.sleep(5)
# # 滚动到任意像素
# devier.execute_script('window.scrollTo(0,2000)')
# time.sleep(3)
# # 滚动到底部
# devier.execute_script('window.scrollTo(0,document.body.scrollHeight)')
# time.sleep(3)
# # 滚动到顶部
# devier.execute_script('window.scrollTo(0,0)')


driver=webdriver.Edge()
driver.get("http://baidu.com")
driver.maximize_window()
driver.find_element(By.LINK_TEXT,"登录").click()
time.sleep(3)
driver.find_element(By.XPATH,'//*[@id="TANGRAM__PSP_11__userName"]').send_keys('18238680385')
driver.find_element(By.CSS_SELECTOR,'#TANGRAM__PSP_11__password').send_keys('wjy2166135035')
driver.find_element(By.NAME,'isAgree').click()
driver.find_element(By.XPATH,'//*[@id="TANGRAM__PSP_11__submit"]').click()

time.sleep(5)
